﻿using System;
using UnityEngine;

namespace RenderHeads.Media.AVProVideo
{
	// Token: 0x0200001C RID: 28
	[ExecuteInEditMode]
	[AddComponentMenu("AVPro Video/Display Background", 200)]
	[HelpURL("http://renderheads.com/product/avpro-video/")]
	public class DisplayBackground : MonoBehaviour
	{
		// Token: 0x060000A8 RID: 168 RVA: 0x000073AC File Offset: 0x000055AC
		private void OnRenderObject()
		{
			if (this._material == null || this._texture == null)
			{
				return;
			}
			Vector4 vector = new Vector4(0f, 0f, 1f, 1f);
			this._material.SetPass(0);
			GL.PushMatrix();
			GL.LoadOrtho();
			GL.Begin(7);
			GL.TexCoord2(vector.x, vector.y);
			GL.Vertex3(0f, 0f, 0.1f);
			GL.TexCoord2(vector.z, vector.y);
			GL.Vertex3(1f, 0f, 0.1f);
			GL.TexCoord2(vector.z, vector.w);
			GL.Vertex3(1f, 1f, 0.1f);
			GL.TexCoord2(vector.x, vector.w);
			GL.Vertex3(0f, 1f, 0.1f);
			GL.End();
			GL.PopMatrix();
		}

		// Token: 0x040000A0 RID: 160
		public IMediaProducer _source;

		// Token: 0x040000A1 RID: 161
		public Texture2D _texture;

		// Token: 0x040000A2 RID: 162
		public Material _material;
	}
}
